package com.jzo2o.customer.controller.worker;

import com.jzo2o.common.handler.UserInfoHandler;
import com.jzo2o.common.model.Result;
import com.jzo2o.customer.model.dto.request.WorkerCertificationInfoDTO;
import com.jzo2o.customer.model.dto.response.NewRejectReason;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("consumerWorkerController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端认证相关接口")
public class WorkerController {


    @Resource
    private IWorkerCertificationService  workerCertificationService;
    @Resource
    private UserInfoHandler userInfoHandler;
    @PostMapping()
    @ApiOperation("服务端申请认证")
    public Result InstitutionResetPassword(@RequestBody WorkerCertificationInfoDTO  workerCertificationInfoDTO) {
        workerCertificationService.add(workerCertificationInfoDTO);
        return Result.ok();
    }
    //查询最新驳回原因
    @GetMapping("rejectReason")
    @ApiOperation("查询最新驳回原因")
    public NewRejectReason rejectReason() {
        String rejectReason = workerCertificationService.queryNewRejectReason();
        NewRejectReason newRejectReason = new NewRejectReason();
        newRejectReason.setRejectReason(rejectReason);
        return newRejectReason;
    }
}
